package com.tubi.arrayFunction;

public class Demo2ArrayFun {
    /*
    * 获取数组的最值
    * */
    public static void main(String[] args) {
        //获取数组的最大值
        int[] arr = {2,3,24,42,5,32,245};
        int max = arr[0];
        for (int i = 1; i <arr.length ; i++) {
            if(max < arr[i]){
                max = arr[i];
            }
        }
        System.out.println(max);
    }
}
